<#include "layout/template.ftl"/>

<@htmlHead title="导入网点">
   
</@htmlHead>


 
<@htmlBody 'branch' 'branchManage'>

	<!-- breadcrumbs begin -->
	<#include "layout/breadcrumbs.ftl">
	<@breadcrumbs '网点管理' '导入网点'></@breadcrumbs>
	<!-- breadcrumbs end -->

	<!-- page-content begin -->
	<div class="page-content">
			
			<!-- page-header begin -->
			<div class="page-header">
					<h1>
						导入网点
					</h1>
			</div>
			<!-- page-header end -->
			
				<div class="col-md-8 col-md-offset-2" style="background-color:#CEFFCE">
					<ul style="list-style-type:none;font-size:14px;"><li>温馨提示	：</li>
							<li>请先下载导入模板，按照模板导入数据！<a href="${resources}/file/branch.xls">
						<i class="ace-icon  fa fa-plus"></i> 下载</li>
					</a>
				
				</ul>
							</div>
			
			<!-- page-body begin -->
			<div class="row">	
				<div class="col-md-8 col-md-offset-2">
					
						<!-- 表单开始 -->
						<form class="form-horizontal" id="validation-form" method="post" action="${path}/manage/bank/branch/import"  enctype="multipart/form-data">
									
				
					
									<!-- edit-basic: 编辑信息面板 begin -->
									<div id="edit-basic" class="" style="border: 1px solid #98DAF0;padding: 0px 15px;margin-top: 10px;">
										
										<h4 class="header blue bolder smaller">导入数据</h4>
											
											
										<div style="padding:10px;height:80px;">
											
											<div class="col-md-4 col-md-offset-2">
												<input type="text" style="width:100%;height:44px;" name="fileField" value="" id="customerpath">
											</div>
											
											<div class="col-md-2">
												<a onclick="document.getElementById('file').click();"  class="btn btn-warning"> 选择EXCEL文件</a>
				                        		<input type="file" style="display: none" accept="application/msexcel" name="file" id="file" class="upload_file1" onchange="document.getElementById('customerpath').value=this.value;"/>
											</div>
										</div>
									</div>
									<!-- edit-basic: 编辑信息面板 end -->
								
								
						</form>
						<!-- 表单结束 -->
						
						


						<!-- 提交开始 -->
	                    <div class="form-group">
	                    	<div class="col-md-8 center">
		                    	<button id="form-submit" type="button" onclick="mysubmit('validation-form')"  class="btn btn-primary">
									<i class="fa fa-save align-top bigger-125"></i>保存
								</button>
							 
								<button type="reset" class="btn">
									<i class="fa fa-pencil align-top bigger-125"></i>重置
								</button>
							</div>					
                   		</div>
						<!-- 提交结束  -->
				</div>
			</div>
			<!-- page-body end -->
		
	</div>		
	<!-- page-content end -->

</@htmlBody>



<@htmlBodyScript>

	<!-- 富文本编辑器 -->
	<script charset="utf-8" src="${resources}/plugins/kindeditor/4.1.10/kindeditor.js"></script>
	<script charset="utf-8" src="${resources}/plugins/kindeditor/4.1.10/lang/zh_CN.js"></script>
    <!-- 实例化编辑器 -->
    <script type="text/javascript">
		var editor;
	    KindEditor.ready(function(K) {
	            editor = K.create('#content', {
	                    resizeType : 1,
	                    pasteType  : 1,
	                    uploadJson : '${path}/richtext/upload/pic/0/0',
	        		    height : "350px",
	        		    items : ['source', '|',
	                 		    'undo', 'redo', '|', 
	                 		    'cut', 'copy', 'paste','|',
	        		           'justifyleft', 'justifycenter', 'justifyright','justifyfull','|',
	        		           'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',  'superscript','|',
	        		           'image', 'table', 'hr', 'link', 'unlink', '|', 
	        		           'title', 'fontname', 'fontsize', 'forecolor','hilitecolor','|',
	        		           'bold', 'italic', 'underline', 'removeformat', '|', 'about'],
	        		    afterSetData : function(id) {}
	            });
	 	});

    </script>

	<!-- 上传控件 -->
	<script type="text/javascript" src="${resources}/assets/js/ajaxfileupload.js"></script>
	<script src="${resources}/plugins/letsun-upload/upload.js"></script>
	<script>
	    /**
	     * 功能 : 提交表单
		 */
	 	function mysubmit(form){
	    	
	 		$("#"+form).submit();
	 	}
		
	</script>

	<!-- 验证框架 -->	
	<script src="${resources}/plugins/jquery-validation/jquery.validate.min.js"></script>
	<script src="${resources}/plugins/jquery-validation/messages_zh.min.js"></script>
	
	<script type="text/javascript">

			jQuery.validator.addMethod("isName", function(value, element) {       
	 			var corpName =  /^[\u0391-\uFFE5\w\-\s\.]{1,50}$/;
  				 return this.optional(element) || corpName.test(value);       
 			}, "请使用汉字、英文字母、数字、下划线、减号、空格或点");   
 			
	
			$('#validation-form').validate({
				errorElement: 'div',
				errorClass: 'help-block',
				focusInvalid: false,
				rules: {
					title: {
						required:true,
						maxlength:30
					},
					picurl: {
						required:true
					}
				},
		
				messages: {
				},
		
		
				highlight: function (e) {
					$(e).closest('.form-group').removeClass('has-info').addClass('has-error');
				},
		
				success: function (e) {
					$(e).closest('.form-group').removeClass('has-error');//.addClass('has-info');
					$(e).remove();
				},
		
				errorPlacement: function (error, element) {
					if(element.is('input[type=checkbox]') || element.is('input[type=radio]')) {
						var controls = element.closest('div[class*="col-"]');
						if(controls.find(':checkbox,:radio').length > 1) controls.append(error);
						else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));
					}
					else if(element.is('.select2')) {
						error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));
					}
					else if(element.is('.chosen-select')) {
						error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));
					}
					else error.insertAfter(element.parent());
				},
		
				invalidHandler: function (form) {
				}
			});
			
			//导出Excel文件
			function loadExcelFile(){
				var corpId=$("#corp").val();
				
				window.location="${path}/manage/platform/account/load/"+corpId;
			}
			
			
	</script>


</@htmlBodyScript>